package com.wlyy.his.common.domain;

public enum CertType {

    SFZ(0,"身份证"),
    HZ(1,"护照"),
    JGZ(2,"军官证"),
    SBZ(3,"士兵证"),
    HXZ(4,"回乡证"),
    LSSFZ(5,"临时身份证"),
    HHB(6,"户口簿"),
    JINGGZ(7,"警官证"),
    TBZ(8,"台胞证"),
    YYZZ(9,"营业执照"),
    QT(10,"其它证件"),
    GAJMLWNDTXZ(11,"港澳居民来往内地通行证"),
    TWJMLWDLTXZ(12,"台湾居民来往大陆通行证"),
    TWJMJZZ(13,"台湾居民居住证"),
    GAJMJZZ(14,"港澳居民居住证"),
    GASFZ(15,"港澳身份证"),
    WGRYJJZZ(16,"外国人永久居住证");

    /**
     * 类型的数字
     */
    private final Integer typeInt;

    /**
     * 证件类型的字符串
     */
    private final String typeStr;

    CertType(Integer typeInt, String typeStr) {
        this.typeInt = typeInt;
        this.typeStr = typeStr;
    }


    public Integer getTypeInt() {
        return typeInt;
    }

    public String getTypeStr() {
        return typeStr;
    }

    /**
     *
     * @param typeInt 数字
     * @return String 对应的字符串
     */
    public static String getTypeStr(int typeInt){
        for (CertType e: CertType.values()) {
            if(typeInt == e.getTypeInt()){
                return e.getTypeStr();
            }
        }
        return "";
    }

    public static Integer getTypeInt(String typeStr){
        for (CertType e: CertType.values()) {
            if(typeStr.equals(e.getTypeStr())){
                return e.getTypeInt();
            }
        }
        return -1;
    }
}
